package actionHandlers;

import java.awt.event.*;
import javax.swing.*;
import java.awt.Color;
import palette.CurrentColor;

public class ColorHandler implements ActionListener{

	public void actionPerformed(ActionEvent arg0) {
		Color c = JColorChooser.showDialog(new JWindow(), "Choose Color", 
				CurrentColor.getInstance());
		if (c==null) {
			c = CurrentColor.getInstance();
		}
		else {
			CurrentColor.getInstance().setColor(c);
		}
		((JButton)arg0.getSource()).setBackground(CurrentColor.getInstance());
	}
}
